package com.mg.framework.kernel;

import android.graphics.Bitmap;
import android.graphics.Canvas;

public abstract class GameStage extends Actor {

	private float px;
	private float py;
	private float ratio;

	public GameStage(Screen screen, int width, int height) {
		super(screen, width, height);
	}

	protected void setMapAreaWidthHeight(int width, int height) {
		this.setWidthAndHeight(width, height);
		this.px = this.width / 2;
		this.py = this.height / 2;
		this.screen.setStage(this);
	}

	protected void setRatio(float ratio) {
		this.ratio = ratio;
	}

	protected void drawColor(int color) {
		this.canvas.drawColor(color);
	}

	protected void drawBitmap(Bitmap bitmap) {
		this.canvas.drawBitmap(bitmap, 0, 0, null);
	}

	@Override
	public void screenUpdate(Canvas canvas) {
		this.Scale(this.ratio, this.ratio, this.px, this.py);
		this.drawSelf(canvas, null);
	}

	public abstract void mapUpdate();
}
